/*
 * imcfg
*/
define(function(){
    var id = guid();

    function draw(ioid, data){
        if(true){//ioid验证
            painting(ioid, data.id, data.action, data.pos);
        }
    };
    function draws(data, cb){
        var len = data.length;
        var d;
        for (var i = 0; i < len; ++i) {
            d = data[i].data;
            imcfg.painting(data[i].action, d.id, d.action, d.pos);
        };
        cb();
    }

    function painting(ioid, cid, action, pos){
        if(ioid === id){
            if(typeof dianliao == 'object'){
                dianliao.draw(ioid, {
                    id:cid,
                    action:action,
                    pos:pos
                });
            }
            return 0;
        }
        imcfg.painting(ioid, cid, action, pos);
    };
    function S4() {
       return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
    };
    function guid() {
       return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
    };
    return {
        id:id,//唯一ID
        draw:draw,//
        draws:draws,
        painting:painting
    };
});